package hari3.tes.soal1;

public class ValidateTime {
	public static void main(String[] args) {
		String time = args[0];
		
		
		int jeda = time.indexOf(":");		
		String jam = time.substring(0, jeda);
		int intJam = Integer.parseInt(jam);
		
		String menit = time.substring(jeda+1);
		int intMenit = Integer.parseInt(menit);
		

		String validJam = null, validMenit = null;
		
		if(intJam <= 23 )  validJam = "valid";
		if(intMenit <= 59) validMenit = "valid";
		
		System.out.print(jam + ":" + menit);
		if(validJam == "valid" && validMenit == "valid")
			System.out.println(" is valid time format");
		else System.out.println(" is invalid time format");
	}
}
